import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
// type 可选择类型externalLink（外部地址）switchTab（tabbar配置的）navigateTo（正常地址）
const store = new Vuex.Store({
	state: {
		roleCodeList: [],
		manage: 'manage', //总管理员权限字符
		driver: 'driver', //司机权限字符
		departures: 'departures', //入殓师权限字符
		guardianInCharge: 'vigil', //守灵厅负责人权限字符
		farewellInCharge: 'farewellHallManager', //告别厅负责人权限字符
		cremationInCharge: 'cremator', //火化负责人权限字符
		burnInCharge: 'incinerator', //焚烧负责人权限字符
		refrigerateInCharge: 'refrigerator', // 冷藏负责人权限字符
		depositInCharge: 'depositoryManager', // 寄存负责人权限字符
		tabBarList: [
			{
				id: 1,
				iconPath: '../../static/tabbar/home.png',
				selectedIconPath: '../../static/tabbar/home-active.png',
				text: '首页',
				path: '/pages/tabbar/home',
				type: 'switchTab'
			},
			{
				id: 2,
				iconPath: '../../static/tabbar/ku.png',
				selectedIconPath: '../../static/tabbar/ku.png',
				text: '功能',
				path: '/pages/tabbar/list',
				type: 'switchTab'
			},
			{
				iconPath: '../../static/tabbar/mine.png',
				selectedIconPath: '../../static/tabbar/mine-active.png',
				text: '我的',
				path: '/pages/tabbar/my',
				type: 'switchTab'
			},
		],
		current: 0
	},
	mutations: {
		updateCurrent(state, index) {
			state.current = index;
		},
		roleCodeListEdit(state, index) {
			console.log('修改');
			state.roleCodeList = index;
		},
	},
	actions: {
		updateCurrent(context, test) {
			context.commit('updateCurrent', test.current)
		}
	}
})
export default store